﻿CREATE TRIGGER [dbo].[tru_PurchaseBatch]
ON [dbo].[t_PurchaseBatch]
FOR INSERT,UPDATE
AS

IF @@ROWCOUNT = 0 RETURN

SET NOCOUNT ON

UPDATE PB SET Discount = PB.Discount*100
FROM t_PurchaseBatch PB INNER JOIN inserted i ON PB.ID = i.ID
WHERE PB.Discount < 1
